package com.User.entity;

public class UserInstance {
    private static UserInstance instance;
    private Integer id;
    private String nickname;
    private String password;
    private String email;
    private String companyOrSchool;
    private String identity;
    private String signature;
    // 登录状态
    private boolean isLogin = false;
    // 私有构造方法，防止外部实例化
    private UserInstance() {
    }
    public static UserInstance getInstance() {
        if (instance == null) {
            synchronized (UserInstance.class) {
                if (instance == null) {
                    instance = new UserInstance();
                }
            }
        }
        return instance;
    }
    @Override
    public String toString() {
        return "UserInstance{" +
                "id=" + id +
                ", nickname='" + nickname + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", companyOrSchool='" + companyOrSchool + '\'' +
                ", identity='" + identity + '\'' +
                ", signature='" + signature + '\'' +
                ", isLogin=" + isLogin +
                '}';
    }
    public boolean isLogin() {
        return isLogin;
    }
    public void setLogin(boolean login) {
        isLogin = login;
    }
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getNickname() {
        return nickname;
    }
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getCompanyOrSchool() {
        return companyOrSchool;
    }
    public void setCompanyOrSchool(String companyOrSchool) {
        this.companyOrSchool = companyOrSchool;
    }
    public String getIdentity() {
        return identity;
    }
    public void setIdentity(String identity) {
        this.identity = identity;
    }
    public String getSignature() {
        return signature;
    }
    public void setSignature(String signature) {
        this.signature = signature;
    }
}
